<template>
    <div class="app-container home">
        <div v-if="info.agentBean.id">
            <div class="content">
                <div class="title">基本信息</div>
                <div class="info">
                    <div class="item">
                        <div class="left">姓名</div>
                        <div class="right">
                            {{ info.agentBean.agentName }}
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">服务商编号</div>
                        <div class="right">
                            {{ info.agentBean.agentNo }}
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">手机号</div>
                        <div class="right">
                            {{ info.agentBean.phoneNo }}
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">入网时间</div>
                        <div class="right">
                            {{ parseTime(info.agentBean.createTime) }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="content" style="margin-top: 10px">
                <div class="title">认证信息</div>
                <div class="info">
                    <div class="item">
                        <div class="left">姓名</div>
                        <div class="right">
                            {{ info.settleInfoBean.bankAccountName }}
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">身份证号</div>
                        <div class="right">
                            {{ replaceStr(6, 16, info.settleInfoBean.identityNo) }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="content" style="margin-top: 10px">
                <div class="title">结算信息</div>
                <div class="info">
                    <div class="item">
                        <div class="left">卡号</div>
                        <div class="right">
                            {{ info.settleInfoBean.bankAccountNo }}
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">开户行</div>
                        <div class="right">
                            {{ info.settleInfoBean.bankName }}
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">手机号</div>
                        <div class="right">
                            {{ replaceStr(3, 8, info.settleInfoBean.prePhone) }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="content" style="margin-top: 10px">
                <div class="title">
                    费率成本
                </div>
                <div class="info">
                    <div class="item">
                        <div class="left">
                            贷记卡T0
                        </div>
                        <div class="right">
                            {{ info.costBeanList[0].t0CreditCardRate }}  %
                        </div>
                    </div>
                    <div class="item">
                        <div class="left">
                            借记卡T1
                        </div>
                        <div class="right">
                            {{info.costBeanList[0].t1DebitCardRate }} %
                        </div>
                    </div>

                    <div class="item">
                        <div class="left">
                            扫码
                        </div>
                        <div class="right">
                            {{ info.costBeanList[0].ysfRate }} %
                        </div>
                    </div>
                    <div class="item" v-if="info.costBeanList[0].maxZfbRate">
                        <div class="left">支付宝大额成本</div>
                        <div class="right">{{ info.costBeanList[0].maxZfbRate }} %</div>
                    </div>
                    <div class="item" v-if="info.costBeanList[0].bountyCostRate">
                        <div class="left">
                            津贴分润成本
                        </div>
                        <div class="right">
                            {{ info.costBeanList[0].bountyCostRate }} (万)
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup name="myInfo">
import store from '@/store/index'
import { agentFindByAgentNo } from '@/api/agent'
import { parseTime, replaceStr } from '@/utils/utils'
import { findAgentInfoByAgentNo } from '@/api/dataAnalysis'

const info = ref({
    agentBean: {},
    costBeanList: [],
    enterpriseBean: {},
    settleInfoBean: {}
})
const obj = ref({})

const getInfo = () => {
    findAgentInfoByAgentNo({}).then(res => {
        info.value = res.object.agentInfo
        obj.value = res.object
    })
}
getInfo()
</script>

<style scoped lang="scss">
.app-container {
    padding: 10px;

    .content {
        background: #ffffff;
        opacity: 1;
        border-radius: 6px;

        .title {
            font-size: 16px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            height: 42px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: 1px solid #f5f5f5;
            color: #000000;
            opacity: 1;
        }

        .info {
            padding: 0 10px;

            .item {
                padding: 0 10px;
                font-size: 14px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                color: #545454;
                height: 47px;
                border-bottom: 1px solid #f5f5f5;
                opacity: 1;
                display: flex;
                align-items: center;
                justify-content: space-between;
            }
        }
    }
}
</style>
